<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<script>
	
function CreatePerson(name, salary)   //构造函数
	{
				//var obj = new Object();
				this.name= name;
				this.salary = salary;

	}
	
	CreatePerson.prototype.showName= function()
	{
					alert(this.name);
	};
	
	CreatePerson.prototype.showSalary= function()
		{
					alert(this.salary);
		};
	
	var obj = new CreatePerson('albert',35000);
	
	obj.showName();
	obj.showSalary();
	
	var obj2 = new  CreatePerson('albert',55000);
	
	obj2.showName();
	obj2.showSalary();
	
	alert(obj.showName == obj2.showName);
</script>
</head>

<body>
</body>
</html>
